Skip to content

Conversation

agnesas
Copy link
Member

@agnesas agnesas commented Oct 15, 2026 •

Description

Set up the GraphQL API for the Pokémon application and connect it to the MariaDB/MySQL database. This PR includes the GraphQL server and initial schema from #49, as well as the resolvers, Apollo Client integration, and frontend data fetching from #50.

The React frontend can retrieve Pokémon data through the GraphQL API, and the backend includes error handling for failed database queries. The README has also been updated with backend setup and configuration instructions.

Changes

  • Set up an Apollo Server with an initial GraphQL schema and queries.
  • Connect GraphQL resolvers to the MariaDB/MySQL database.
  • Implement queries for retrieving all Pokémon and retrieving a Pokémon by ID.
  • Configure Apollo Client in the React frontend.
  • Display Pokémon data retrieved from the GraphQL API.
  • Handle loading states, failed queries, and missing Pokémon.
  • Mask internal GraphQL errors to avoid exposing database details and stack traces.
  • Document backend installation, database configuration, startup, and example queries in the README.

Testing

  • Verified that the backend builds and starts successfully on the VM without Docker.
  • Verified that GraphQL queries retrieve Pokémon data from the database.
  • Verified that querying a nonexistent Pokémon returns null.
  • Verified that the frontend displays data retrieved through GraphQL.
  • Tested database authentication failure and confirmed that the response does not expose internal database details or stack traces.
  • Verified that the backend works normally again with valid database credentials.

Issue

Closes: #48, which includes #49, #50, #51 and #52

@larsjfo
Copy link
Member

larsjfo commented Oct 15, 2026

Overall we have a lot of conflicts between this PR and #55. We have to make sure both PR's work well together. I suggest merging #55 first, then rebase main into 50-implement-resolvers-and-connect-graphql-to-mysql. Afterward we can make sure everything works as expected.

agnesas and others added 9 commits October 16, 2026 17:47
- Configure Apollo Server with Node.js and TypeScript
- Define the initial Pokémon GraphQL schema and queries
- Add backend setup instructions to the README
- Add a root .gitignore for dependencies, build output, and secrets
- Configure Apollo Server with Node.js and TypeScript
- Define the initial Pokémon GraphQL schema and queries
- Add backend setup instructions to the README
- Add a root .gitignore for dependencies, build output, and secrets
@agnesas agnesas force-pushed the 50-implement-resolvers-and-connect-graphql-to-mysql branch from 02fbffb to 8a7c001 Compare October 16, 2026 15:53
@agnesas agnesas requested a review from larsjfo October 16, 2026 16:09
Copy link
Member

@larsjfo larsjfo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great work!

@agnesas agnesas merged commit 4ee48a1 into main Oct 18, 2026
@agnesas agnesas deleted the 50-implement-resolvers-and-connect-graphql-to-mysql branch October 18, 2026 10:23
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
2 participants